﻿@using ArticleWeb.Models
@model LoginViewModel
@{
    ViewBag.Title = "登录";
}
<div id="loginForm">
    @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "layui-form", role = "form", style = "padding:68px 60px 0 0;" }))
    {
        @Html.AntiForgeryToken()
        <div class="layui-form-item">
            @Html.LabelFor(m => m.Email, new { @class = "layui-form-label" })
            <div class="layui-input-block">
                @Html.ValidationSummary(true, "", new { @class = "text-danger" })
                @Html.TextBoxFor(m => m.Email, new { @class = "layui-input" })
                @Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" })
            </div>
        </div>
        <div class="layui-form-item">
            @Html.LabelFor(m => m.Password, new { @class = "layui-form-label" })
            <div class="layui-input-block">
                @Html.PasswordFor(m => m.Password, new { @class = "layui-input" })
                @Html.ValidationMessageFor(m => m.Password, "", new { @class = "text-danger" })
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                @Html.CheckBoxFor(m => m.RememberMe, new { @class = "layui-checkbox", lay_skin = "primary", title = "记住密码" })
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <input type="submit" value="登录" class="layui-btn" />
            </div>
        </div>
    }
</div>
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    <script>
        $('.layui-nav').hide();
        layui.define(['form', 'layer', 'element'], function () {
            layui.form();
            layer.open({
                move: false,
                close: false,
                type: 1,
                scrollbar: false,
                title: document.title,
                area: ['500px', '360px'],
                content: ''
            });
            $('.layui-layer-content').append($('#loginForm'))
            $('#loginForm input[type=submit]').click(function () {
                layer.load(2);
            });
        });
    </script>
}
